package com.rtx.edi.platform.jobextend.bean.dto;

import java.util.List;

import com.rtx.edi.model.apibaseinfo.po.PlApibaseinfo;
import com.rtx.edi.model.application.po.PlApplicationEnvironment;
import com.rtx.edi.platform.jobextend.bean.po.PlJob;
import com.rtx.edi.platform.jobextend.bean.po.PlJobDetail;
import com.rtx.edi.platform.jobextend.bean.po.PlJobMapping;

public class JobConfigDTO {
    private PlJob plJob;//定时任务
    private List<PlJobDetail> plJobDetails;//定时任务详情
    private List<PlJobMapping> plJobMappings;//定时任务字段映射
    private PlApibaseinfo apiInfo;//目标API信息
    private PlApplicationEnvironment environment;//目标应用环境
    private String url;//目标请求地址
    private Object data;//请求数据

    public JobConfigDTO() {
    }

    public JobConfigDTO(PlJob plJob, List<PlJobDetail> plJobDetails, List<PlJobMapping> plJobMappings) {
        this.plJob = plJob;
        this.plJobDetails = plJobDetails;
        this.plJobMappings = plJobMappings;
    }

    public PlJob getPlJob() {
        return plJob;
    }

    public void setPlJob(PlJob plJob) {
        this.plJob = plJob;
    }

    public List<PlJobDetail> getPlJobDetails() {
        return plJobDetails;
    }

    public void setPlJobDetails(List<PlJobDetail> plJobDetails) {
        this.plJobDetails = plJobDetails;
    }

    public List<PlJobMapping> getPlJobMappings() {
        return plJobMappings;
    }

    public void setPlJobMappings(List<PlJobMapping> plJobMappings) {
        this.plJobMappings = plJobMappings;
    }

    public String getUrl() {
        if(this.environment != null && this.apiInfo != null){
            return this.environment.getBasicurl() + this.apiInfo.getApiDomail();
        }
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public PlApibaseinfo getApiInfo() {
        return apiInfo;
    }

    public void setApiInfo(PlApibaseinfo apiInfo) {
        this.apiInfo = apiInfo;
    }

    public PlApplicationEnvironment getEnvironment() {
        return environment;
    }

    public void setEnvironment(PlApplicationEnvironment environment) {
        this.environment = environment;
    }
}
